var noticiesViews ={
	getViews : function (){
		return {

			nav : Titanium.UI.iPhone.createNavigationGroup({
				 window: Titanium.UI.createWindow({
					barColor:'#333',
					title: L("Bloc"),
					backgroundImage:'../img/background2.png'
				})
			}),

			tableview : Ti.UI.createTableView({
				data:data,
				backgroundColor:'transparent',
				separatorStyle:0,
				maxRowHeigh:100,	
				minRowHeight:60,
				filterAttribute:'searchTxt',
				searchHidden:true,
				search:
					Ti.UI.createSearchBar({
					showCancel:false,
					autocorrect:false,
					backgroundColor:'#333',
					barColor:'#333'
				})
			}),

			activityIndicatorView : Ti.UI.createView({
				left:0,
				right:0,
				top:0,
				bottom:0,
				backgroundColor:'#000',
				opacity:0.8,
				visible:false
			}),
			
			activityIndicator : Titanium.UI.createActivityIndicator({
				top:160,
				height:60,
				width:'auto',
				color:'#FFFFFF',
				style:Ti.UI.iPhone.ActivityIndicatorStyle.BIG,
				message:L("Carregant"),
				visible:true
			}),
			
			refreshButton : Ti.UI.createButton({
				systemButton:Ti.UI.iPhone.SystemButton.REFRESH
			})
		};
	
	
	},	
		
	getNoticiaRow : function (id,tipus,title ,pubDate,link){
		var imatge='';

		/* 0 pirata.cat
		 * 1 youtube
		 * 2 flickr
		 * 3 nacionred
		 */
		switch(tipus){
			case 0:	imatge='../img/ic_info_bloc.png';				break;
			case 1:	imatge='../img/ic_info_youtube.png';			break;
			case 2:	imatge='../img/ic_info_flickr.png';			break;
			case 3:	imatge='../img/ic_info_ppinternational.png';
					link =link.replace('www.nacionred', 'm.nacionred');
					break;
			default:imatge='../img/ic_info_bloc.png';				break;
		}
		
		var row = Ti.UI.createTableViewRow({
			height:'auto',
			opacity:0,
			backgroundColor:'transparent',
			selectedBackgroundColor:'#333',
			//borderWidth:0.0,
			//borderRadius:"12",
			leftImage:imatge,
			fontSize:"12",
			tipus:tipus,
			titol:title,
			pubDate:pubDate,
			link:link,
			rightImage:'../img/disclosureArrow.png',
			searchTxt:title
			//className:"rowNoticia"
		});

		var labelDate = Ti.UI.createLabel({
			height:'auto',
			textAlign:'center',
			left:50,
			width:35,
			text:pubDate,
			color:'#CCC',
			font:{fontSize:14}
		});
		var labelTitle = Ti.UI.createLabel({
			height:'auto',
			left:95,
			right:10,
			text:title,
			color:'#eee',
			font:{fontSize:14}
		});
		row.searchTxt = title;
		row.add(labelDate,labelTitle);
		
		return row;
	},
	
	getNoticiaDetailWindow : function (titol,tipus){
		return { 
			w : Ti.UI.createWindow({
				backgroundColor:'#000',
				barColor:'#333',
				backButtonTitle:L("Tornar"),
				titleControl: Ti.UI.createLabel({
						text:titol,
						width:'auto',
						right:0,
						color:'#fff',
						font:{fontSize:12}
				})
			}),
		
			wb : Ti.UI.createWebView({
				top:0,
				backgroundColor : '#000',
				tipusPagina : tipus
			})
		};
	}
		
		
};